<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class utb_bridge</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class utb_bridge</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Bridge Class</p>
<p class="description"><p>Provides methods for client/server interaction.</p></p>
		<p class="notes">
			Located in <a class="field" href="_gui---index.php.html">/gui/index.php</a> (line <span class="field"><a href="../__filesource/fsource_bridge__guiindex.php.html#a225">225</a></span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																								<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$_client" title="details" class="var-name">$_client</a>
				</div>
																<div class="var-title">
					<span class="var-type">array</span>
					<a href="#$_data" title="details" class="var-name">$_data</a>
				</div>
																<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$_pass" title="details" class="var-name">$_pass</a>
				</div>
																<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$_server" title="details" class="var-name">$_server</a>
				</div>
																<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$_user" title="details" class="var-name">$_user</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																				<div class="method-definition">
					static 						<span class="method-result">void</span>
										<a href="#log" title="details" class="method-name">log</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$message</span>, [<span class="var-type">integer</span>&nbsp;<span class="var-name">$error_level</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
					static 						<span class="method-result">void</span>
										<a href="#quit" title="details" class="method-name">quit</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$client_message</span> = <span class="var-default">'invalid request'</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$log_entry</span> = <span class="var-default">null</span>])
									</div>
																																																																
												<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
										()
									</div>
																																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_attach_server" title="details" class="method-name">_attach_server</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_auth_client" title="details" class="method-name">_auth_client</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_list_transfers" title="details" class="method-name">_list_transfers</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_parse_request" title="details" class="method-name">_parse_request</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_perform_action" title="details" class="method-name">_perform_action</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$action</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">mixed</span>
										<a href="#_read_cache" title="details" class="method-name">_read_cache</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$cache_id</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#_write_cache" title="details" class="method-name">_write_cache</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
									</div>
								</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$_client" id="$_client"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$_client</span>
						(line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a236">236</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Client Address</p>
<p class="description"><p>Address of connected client.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$_data" id="$_data"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$_data</span>
			 = <span class="var-default">array('build' =&gt; UTORRENT_BUILD)</span>			(line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a282">282</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Client Data</p>
<p class="description"><p>Client data returned in JSON format.</p></p>
	<ul class="tags">
				<li><span class="field">internal:</span> uTorrent build number required</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$_pass" id="$_pass"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$_pass</span>
						(line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a258">258</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Client Password</p>
<p class="description"><p>Password used for server authentication.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$_server" id="$_server"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$_server</span>
						(line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a269">269</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Server Module</p>
<p class="description"><p>Server module container.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$_user" id="$_user"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$_user</span>
						(line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a247">247</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Client Username</p>
<p class="description"><p>Username used for server authentication.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodlog" id="log"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">static method log</span> (line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a826">826</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Log Message</p>
<p class="description"><p>Logs messages to file.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> ryon.sherman</li>
				<li><span class="field">see:</span> E_USER_ERROR</li>
				<li><span class="field">see:</span> E_USER_ERROR</li>
				<li><span class="field">see:</span> E_USER_WARNING</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">void</span>
		<span class="method-name">
			log
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$message</span>, [<span class="var-type">integer</span>&nbsp;<span class="var-name">$error_level</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$message</span><span class="var-description">: Log entry</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$error_level</span><span class="var-description">: Error level</span>			</li>
				</ul>
		
			
	</div>
<a name="methodquit" id="quit"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method quit</span> (line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a883">883</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Terminate Service</p>
<p class="description"><p>Terminates the script after logging.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> ryon.sherman</li>
				<li><span class="field">internal:</span> Default uTorrent message is 'invalid request'</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">void</span>
		<span class="method-name">
			quit
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$client_message</span> = <span class="var-default">'invalid request'</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$log_entry</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$client_message</span><span class="var-description">: Last message sent to client</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$log_entry</span><span class="var-description">: Last log entry</span>			</li>
				</ul>
		
			
	</div>

<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a295">295</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Bridge Class Constructor</p>
<p class="description"><p>Performs user authentication, server actions,  and renders JSON output.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> JSON encoded client data</li>
				<li><span class="field">author:</span> ryon.sherman</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			__construct
		</span>
				()
			</div>
	
		
			
	</div>
<a name="method_attach_server" id="_attach_server"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_attach_server</span> (line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a360">360</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Attach Server Module</p>
<p class="description"><p>Locates and attaches the server module to it's container.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> ryon.sherman</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_attach_server
		</span>
				()
			</div>
	
		
			
	</div>
<a name="method_auth_client" id="_auth_client"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_auth_client</span> (line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a319">319</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Authenticate Client</p>
<p class="description"><p>Performs user credential acquisition for server  authentication.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> ryon.sherman</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_auth_client
		</span>
				()
			</div>
	
		
			
	</div>
<a name="method_list_transfers" id="_list_transfers"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_list_transfers</span> (line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a424">424</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">List Transfers</p>
<p class="description"><p>Lists current transfers on the server. Caching is used  to reduce network load.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> ryon.sherman</li>
				<li><span class="field">todo:</span> Support transfer labels.</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_list_transfers
		</span>
				()
			</div>
	
		
			
	</div>
<a name="method_parse_request" id="_parse_request"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_parse_request</span> (line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a396">396</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Parse Client Request</p>
<p class="description"><p>Parses client request and determines server actions.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> ryon.sherman</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_parse_request
		</span>
				()
			</div>
	
		
			
	</div>
<a name="method_perform_action" id="_perform_action"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_perform_action</span> (line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a511">511</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Perform Server Action</p>
<p class="description"><p>Performs requested action on the server.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> ryon.sherman</li>
				<li><span class="field">todo:</span> Support file addition via HTTP POST</li>
				<li><span class="field">todo:</span> Support file priority modification</li>
				<li><span class="field">todo:</span> Support transfer property modification</li>
				<li><span class="field">todo:</span> Support server setting modification</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_perform_action
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$action</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$action</span>			</li>
				</ul>
		
			
	</div>
<a name="method_read_cache" id="_read_cache"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_read_cache</span> (line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a752">752</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Read Cache</p>
<p class="description"><p>Reads cached data from a temporary file.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> Cached data</li>
				<li><span class="field">author:</span> ryon.sherman</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			_read_cache
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$cache_id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$cache_id</span><span class="var-description">: Id of cached file</span>			</li>
				</ul>
		
			
	</div>
<a name="method_write_cache" id="_write_cache"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_write_cache</span> (line <span class="line-number"><a href="../__filesource/fsource_bridge__guiindex.php.html#a792">792</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Write Cache</p>
<p class="description"><p>Writes data to a temporary cache file.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> New cache Id</li>
				<li><span class="field">author:</span> ryon.sherman</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			_write_cache
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$data</span><span class="var-description">: Data to cache</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Wed, 16 Dec 2009 10:32:57 -0600 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</div></body>
</html>